package com.atguigu.gmall.juc.threadlocal;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/5/31 2:36
 */
public class ThreadlocalTest {


    public static String simpleDate(int sends){
        Date date = new Date(1000*sends);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd SS:HH:mm");
        return simpleDateFormat.format(date);
    }

    public static void main(String[] args) {

        new Thread(new Runnable() {
            @Override
            public void run() {
                String date = ThreadlocalTest.simpleDate(200);
                System.out.println(Thread.currentThread().getName()+"--->"+date);
            }
        },"111-m").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                String date = ThreadlocalTest.simpleDate(200000);
                System.out.println(Thread.currentThread().getName()+"--->"+date);
            }
        },"222-m").start();

    }
}
